package com.eurasia.assignment.service;

import com.eurasia.assignment.infrastructure.repository.StatisticsRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class StatisticsService {
    private final StatisticsRepository statisticsRepository;

    @Autowired
    public StatisticsService(StatisticsRepository statisticsRepository) {
        this.statisticsRepository = statisticsRepository;
    }

    // 移除了static修饰符
    public long countAllStudents() {
        return statisticsRepository.countAllStudents();
    }

    // 新增专门查询学生人数的方法
    public long countStudentsWithRole() {
        return statisticsRepository.countStudentsWithRole();
    }
}